package com.jsbs.iam.api.system;

import com.jsbs.iam.common.core.constant.SecurityConstants;
import com.jsbs.iam.common.core.constant.ServiceNameConstants;
import com.jsbs.iam.common.core.domain.R;
import com.jsbs.iam.api.system.factory.RemoteAuthFallbackFactory;
import com.jsbs.iam.api.system.model.ApiDataReqForm;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * 授权验证服务
 * 
 * @author junwc
 */
@FeignClient(contextId = "remoteAuthService", value = ServiceNameConstants.AUTH_SERVICE, fallbackFactory = RemoteAuthFallbackFactory.class)
public interface RemoteAuthService
{
    /**
     * 验证签名
     *
     * @param reqForm
     * @param source 请求来源
     * @return 结果
     */
    @PostMapping("/openApi/checkSign")
    R checkSign(@RequestBody ApiDataReqForm reqForm, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
